		<div class="search-box">
	<form class="search_form layui-form" lay-filter="importpk_search_form">
		<div class="layui-inline">
			<label class="layui-form-label">回款编号</label>
			<div class="layui-input-inline">
				<input type="text" name="return_code" style="width: 300px;" placeholder="支持多个回款编号,英文逗号分割" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">打款单位</label>
			<div class="layui-input-inline">
				<input type="text" name="title" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-input-inline">
			<select name="order_type" lay-filter="order_type" id="order_type">
				<option value="">认款状态</option>
				<option value="-2">后台匹配中</option>
				<option value="-1">无匹配订单</option>
				<option value="0">有匹配订单</option>
				<option value="1">已认款</option>
				<option value="3">待核实</option>
				<option value="2">已确认</option>
			</select>
		</div>
		<div class="layui-input-inline">
			<select name="runs" lay-filter="runs" id="runs">
				<option value="">匹配数量（之前数据需要重新匹款）</option>
				<option value="1">1条匹配</option>
				<option value="2">2条匹配</option>
				<option value="3">3条匹配</option>
				<option value="4">4条匹配</option>
				<option value="5">5条匹配</option>
				<option value="6">6条匹配</option>
				<option value="7">7条匹配</option>
				<option value="8">8条匹配</option>
			</select>
		</div>
		<div class="layui-inline">
			<div class="layui-input-inline">
				<input type="text" name="min_order_money" autocomplete="off" class="layui-input" placeholder="最低金额">
			</div>
			<div class="layui-input-inline">
				<input type="text" name="max_order_money" autocomplete="off" class="layui-input" placeholder="最高金额">
			</div>
			<div class="layui-input-inline">
				<input type="text" name="order_money" autocomplete="off" class="layui-input" placeholder="准确金额">
			</div>
		</div>
		<div class="layui-input-inline">
			<input type="text" name="pay_time_start" id="pay_time_start_1" autocomplete="off" class="layui-input" placeholder="回款开始日期">
		</div>
		<div class="layui-input-inline">
			<input type="text" name="pay_time_end"  id="pay_time_end_1" autocomplete="off" class="layui-input" placeholder="回款结束日期">
		</div>
		<!-- <div class="layui-input-inline">
		<select name="order_level_search" lay-filter="order_level_search">
			<option value="">订单量</option>
			<option value="1">1个订单</option>
			<option value="2">2个订单</option>
			<option value="3">3个订单</option>
			<option value="4">4个订单</option>
			<option value="5">5个订单</option>
			<option value="6">6个订单</option>
		</select>
		</div>
		<div class="layui-input-inline">
		<select name="times" lay-filter="times">
			<option value="">匹款方式</option>
			<option value="1">初始化</option>
			<option value="2">抬头组合</option>
			<option value="3">地址</option>
			<option value="4">手机号</option>
			<option value="5">销项票</option>
		</select>
		</div> -->
		<div class="layui-inline">
			<div class="layui-input-inline">
				<button lay-submit lay-filter="pikuan_search_btn" id="pikuan_search_btn"
					class="layui-btn layui-btn-normal layui-btn-sm layui-bg-red">搜 索</button>
			</div>
		</div>
		<div class="pack-up"></div>
	</form>
</div>
<div class="oprate-div">
	<form class="layui-form">
	<div style="display: flex;align-items: center;">
		<div class="layui-input-inline" style="color: red;font-weight: 600;">
			查询结果匹款
		</div>
		<div class="layui-input-inline">
			订单时间段：
		</div>
		<div class="layui-input-inline">
			<input type="text" name="pk_create_time_start" autocomplete="off" class="layui-input"
				placeholder="开始日期">
		</div>
		<div class="layui-input-inline">
			<input type="text" name="pk_create_time_end" autocomplete="off" class="layui-input"
				placeholder="结束日期">
		</div>
		<!-- <div style="margin-left: 10px;">订单量：</div>
		<select name="order_level" lay-filter="order_level">
			<option value="2">1个订单</option>
			<option value="3">2个订单</option>
			<option value="4">3个订单</option>
			<option value="5">4个订单</option>
			<option value="6">5个订单</option>
			<option value="7">6个订单</option>
		</select> -->
		<!-- <a style="margin-left: 10px;" type="button" data-title="抬头组合匹款"
			class="layui-btn layui-btn-warm pikuan" data-val="1">抬头组合匹款</a>
		<a style="margin-left: 10px;" type="button" data-title="地址匹款" class="layui-btn layui-btn-warm pikuan"
			data-val="2">地址匹款</a>
		<a style="margin-left: 10px;" type="button" data-title="手机号匹款" class="layui-btn layui-btn-warm pikuan"
			data-val="3">手机号匹款</a>
		<a style="margin-left: 10px;" type="button" data-title="销项票匹款" class="layui-btn layui-btn-warm pikuan"
			data-val="4">销项票匹款</a> -->
		<a style="margin-left: 10px;" type="button" data-title="根据筛选结果和订单时间段进行匹款"
			class="layui-btn layui-btn-warm pikuan" data-val="1">筛选结果匹款</a>
	</div>
	</form>
</div>
<table class="layui-hide" id="importpk" lay-filter="importpk"></table>

<div style="display: none;justify-content: flex-end;">
	<a type="button" data-title="移除已匹配" class="layui-btn layui-btn-normal" id="yichu">移除已匹配</a>
	<a type="button" data-title="已勾选设为手动认款" class="layui-btn layui-btn-danger" id="shoudong">已勾选设为手动认款</a>
	<a type="button" data-title="提交已操作的匹款信息" class="layui-btn" id="tijiao">提交已操作的匹款信息</a>
</div>
<div class="order_info" style="display: none;">
	<table class="layui-table" style="width:1740px;" lay-filter="order_view">
		<thead>
			<tr>
				<th style="width: 80px;"></th>
				<th style="width: 160px;">收货人</th>
				<th style="width: 160px;">手机号</th>
				<th style="width: 240px;">地址</th>
				<th style="width: 160px;">订单号</th>
				<th style="width: 240px;">销项票开票产品名称</th>
				<th style="width: 240px;">抬头</th>
				<th style="width: 240px;">供应商</th>
				<th style="width: 240px;">用户订单备注</th>
				<th style="width: 100px;">前端状态</th>
				<th style="width: 100px;">金额</th>

			</tr>
		</thead>
		<tbody id="order_info_box">

		</tbody>
	</table>
	<table class="layui-table" style="width:1000px ;" lay-filter="xinxi_view">
		<thead>
			<tr>
				<th style="width: 240px;">付款单位</th>
				<th style="width: 360px;">地址</th>
				<th style="width: 160px;">手机号</th>
				<th style="width: 240px;">销项票</th>
			</tr>
		</thead>
		<tbody id="pkxx_box">
	
		</tbody>
	</table>
	<a type="button" id="implodePkd" style="display: none;">导入匹款单</a>
	<a type="button" id="implodeXx" style="display: none;">导入汇款单位</a>
</div>
<script>
	var pkd_data_arr = [],
		order_detail_arr = [],
		select_hkbh = '',
		order_level = 2,
		start_time = '',
		end_time = '',
		importpk_list_url = "{:url('pikuan/importpkList')}",
		importpk_cols = {$cols},
		upload_pkd = '{:url("Pikuan/uploadPkd")}',
		upload_xx = '{:url("Pikuan/uploadXx")}',
		renkuan_url = '{:url("Pikuan/renkuan")}',
		renkuanmul_url = '{:url("Pikuan/renkuanmul")}',
		queren_url = '{:url("Pikuan/queren")}',
		exportpk_url = '{:url("Pikuan/exportpk")}',
		updateSelect_url = '{:url("Pikuan/updateSelect")}',
		shoudong_url = '{:url("Pikuan/shoudong")}',
		viewOrder_url = '{:url("Pikuan/viewOrder")}',
		titlePikuan_url = '{:url("Pikuan/titlePikuan")}';
</script>

<script type="text/html" id="importpkToolbar">
	<div class="layui-btn-container">
		<div class="layui-btn-group">
			<a type="button" data-id="implodePkd" data-url="{:url('pikuan/uploadPkd')}" data-title="导入匹款单"
			 class="layui-btn layui-btn-normal layui-btn-sm" lay-event="implodePkd">导入匹款单</a>
			<a type="button" id="exportpk" data-id="exportpk" data-url="{:url('pikuan/exportpk')}" data-title="导出查询结果"
			 class="layui-btn layui-btn layui-btn-sm" lay-event="exportpk">导出查询结果</a>
			<a type="button" data-id="implodeXx" data-url="{:url('pikuan/uploadXx')}" data-title="导入汇款单位"
			 class="layui-btn layui-btn-normal layui-btn-sm" lay-event="implodeXx">导入汇款单位</a>
		</div>
		<div class="layui-btn-group">
			<button type="button" class="layui-btn layui-btn-sm" data-state="1" lay-event="allChenggong"><i class="layui-icon layui-icon-component"></i>批量成功</button>
			<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" data-state="3" lay-event="allDaiheshi"><i class="layui-icon layui-icon-app"></i>批量待核实</button>
		</div>
		<div class="layui-btn-group">
			<a type="button" target="_blank" href="{:url('supplier/buildtpl/runPikuan')}" data-title="查看匹款进度"
			 class="layui-btn layui-btn-normal layui-btn-sm">查看匹款进度</a>
		</div>
	</div>
</script>

<script type="text/html" id="barPikuan">
	{{# if(d.state == -2){ }}
		后台匹配中
	{{# } }}
	{{# if(d.state == -1){ }}
		<span style="color:#FF5722">无匹配订单</span>
	{{# } }}
	{{# if(d.state == 2){ }}
		<span style="color:#5FB878">已完成</span>
	{{# } }}
	{{# if((d.state == 0 || d.state == 1 || d.state == 3) && d.money > 0){ }}
	<div class="layui-btn-group">
		<a class="layui-btn layui-btn-xs  layui-btn-normal" lay-event="view" data-title="查看">
			<i class="layui-icon layui-icon-rate-solid"></i>
		</a>
		
		{{# if(d.state == 0){ }}
		<a class="layui-btn layui-btn-xs" data-title="认款成功" lay-event="success">
			<i class="layui-icon layui-icon-ok"></i>
		</a>
		<a class="layui-btn layui-btn-xs layui-btn-danger" data-title="待核实" lay-event="confirm">
			<i class="layui-icon layui-icon-app"></i>
		</a>
		
		{{# } }}
	</div>
	{{# } }}

</script>

<script type="text/html" id="pkxxTpl">
	{{# 
		try{
			return d.pkxx.split(",").join("<br />"); 
		} catch(error){
			return ''
		}
	}}
</script>


<script type="text/html" id="openTpl">
{{# if(d.open == 0){}}
	<div class="layui-anim circle layui-bg-green" data-title="可匹款">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
		<div class="layui-anim circle layui-bg-red" data-title="已锁定">
			<i class="layui-icon layui-icon-radio"></i>
		</div>
		{{# }}}
</script>
<script type="text/html" id="stateTpl"> 
	{{# if(d.state == -2){}}
		<div class="layui-anim circle layui-bg-gray" data-title="后台匹配中">
			<i class="layui-icon layui-icon-radio"></i>
		</div>
	{{# }else if(d.state == -1){ }}
		<div class="layui-anim circle layui-bg-red" data-title="无匹配订单">
			<i class="layui-icon layui-icon-radio"></i>
		</div>
	{{# }else if(d.state == 0){ }}
		<div class="layui-anim circle layui-bg-cyan" data-title="有匹配订单">
			<i class="layui-icon layui-icon-radio"></i>
		</div>
	{{# }else if(d.state == 1){ }}
		<div class="layui-anim circle layui-bg-green" data-title="已认款">
			<i class="layui-icon layui-icon-radio"></i>
		</div>
	{{# }else if(d.state == 3){ }}
		<div class="layui-anim circle layui-bg-orange" data-title="待核实">
			<i class="layui-icon layui-icon-radio"></i>
		</div>
	{{# }else if(d.state == 2){ }}
		<div class="layui-anim circle layui-bg-blue" data-title="已完成">
			<i class="layui-icon layui-icon-radio"></i>
		</div>
	{{# }}}
</script>

<script type="text/html" id="runTpl">
{{# if(d.runs == 1){ 	}}
	<div class="layui-anim circle layui-bg-green" data-title="匹配成功">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else if(d.runs == 0) { }}
		<div class="layui-anim circle layui-bg-red" data-title="未成功">
			<i class="layui-icon layui-icon-radio"></i>
		</div>
		{{# } else { }}
			<div class="layui-anim circle layui-bg-yellow" data-title="待选择">
				<i class="layui-icon layui-icon-radio"></i>
			</div>
			{{# } }}
</script>
<script src="/static/js/pikuan/importpk.js?t=20231122" type="text/javascript" charset="utf-8"></script>